<?php
require_once 'model/ModelInterface.php';

# ISE 2012
# php model class
# Person wraps WebUser, Customer and Person informations
class Person implements ModelInterface {
	# identifying
	private $personid;
	private $username;
	# core
	private $salutation;
	private $firstname;
	private $lastname;
	private $email;
	private $born;
	# adress
	private $postcode;
	private $cityname;
	private $street;
	# licence
	private $licencenr;
	private $licencesince;
	# payment
	private $hasCC;
	private $hasBank;
	private $ccnr;
	private $bic;
	private $iban;
	private $premium;
	
	# constructor
	public function __construct() {
		if ($_ccnr) { $this->hasCC = true; }
		if ($_iban && $_bic) { $this->hasBank = true; }
	}
	
	# utils
	public function __toString() {
		return "[".$this->personid.":".$this->username."{".$this->fullName()."}]";
	}	
	public function fullName() {
		return $this->salutation." ".$this->firstname." ".$this->lastname;
	}
	
	# getter
	# generic id getter
	public function getId() {
		return $this->getPersonid();
	}
	
	public function getPersonid() {
		return $this->personid;
	}
	public function getUsername() {
		return $this->username;
	}
	public function getSalutation() {
		return $this->salutation;
	}
	public function getFirstname() {
		return $this->firstname;
	}
	public function getLastname() {
		return $this->lastname;
	}
	public function getEmail() {
		return $this->email;
	}
	public function getBorn() {
		return $this->born;
	}
	public function getPostcode() {
		return $this->postcode;
	}
	public function getCityname() {
		return $this->cityname;
	}
	public function getStreet() {
		return $this->street;
	}
	public function getLicencenr() {
		return $this->licencenr;
	}
	public function getLicencesince() {
		return $this->licencesince;
	}
	public function getCcnr() {
		return $this->ccnr;
	}
	public function getBic() {
		return $this->bic;
	}
	public function getIban() {
		return $this->iban;
	}
	public function isCC() {
		return $this->hasCC;
	}
	public function isBank() {
		return $this->hasBank;
	}
	public function isPremium() {
		return $this->premium;
	}

	public function setPersonid($personid)
	{
	    $this->personid = $personid;
	}

	public function setUsername($username)
	{
	    $this->username = $username;
	}

	public function setSalutation($salutation)
	{
	    $this->salutation = $salutation;
	}

	public function setFirstname($firstname)
	{
	    $this->firstname = $firstname;
	}

	public function setLastname($lastname)
	{
	    $this->lastname = $lastname;
	}

	public function setEmail($email)
	{
	    $this->email = $email;
	}

	public function setBorn($born)
	{
	    $this->born = $born;
	}

	public function setPostcode($postcode)
	{
	    $this->postcode = $postcode;
	}

	public function setCityname($cityname)
	{
	    $this->cityname = $cityname;
	}

	public function setStreet($street)
	{
	    $this->street = $street;
	}

	public function setLicencenr($licencenr)
	{
	    $this->licencenr = $licencenr;
	}

	public function setLicencesince($licencesince)
	{
	    $this->licencesince = $licencesince;
	}

	public function setHasCC($hasCC)
	{
	    $this->hasCC = $hasCC;
	}

	public function setHasBank($hasBank)
	{
	    $this->hasBank = $hasBank;
	}

	public function setCcnr($ccnr)
	{
	    $this->ccnr = $ccnr;
	}

	public function setBic($bic)
	{
	    $this->bic = $bic;
	}

	public function setIban($iban)
	{
	    $this->iban = $iban;
	}

	public function setPremium($premium)
	{
	    $this->premium = $premium;
	}
}
?>